package com.zds.hj.poseidon.biz.cba.hpp.domain.credit.entity;

import com.zds.boot.common.domain.BaseEntity;
import com.zds.boot.jpa.comment.annotation.TableComment;
import com.zds.hj.poseidon.facade.dto.hpp.credit.enums.OrderStateEnum;
import com.zds.hj.product.facade.enums.product.*;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/* *
 * ==================================================
 * <p>
 * FileName: ApplyInfoEntity
 *
 * @author : shihongwei
 * @create 2019/4/16
 * @since 1.0.0
 * 〈功能〉：
 * ==================================================
 */
@Entity
@TableComment("授信信息")
@Table(name = "hj_hpp_credit_apply_info")
@Setter
@Getter
public class CreditInfoEntity extends BaseEntity {

    /* * 申请流水号*/
    @Column(name = "apply_no", columnDefinition = "varchar(64) NOT NULL  COMMENT '申请流水号'")
    private String applyNo;

    /* * 产品id */
    @Column(name = "product_id", columnDefinition = "bigint(19) COMMENT '产品id'")
    private Long productId;

    /* * 产品编号 */
    @Column(name = "product_no", columnDefinition = "varchar(64) COMMENT '信贷产品编号'")
    private String productNo;

    /* * 产品类别*/
    @Column(name = "product_type", columnDefinition = "varchar(64) NOT NULL  COMMENT '产品类别'")
    private ProductTypeEnum productType;

    /* * 产品名称 */
    @Column(name = "product_name", columnDefinition = "varchar(64) COMMENT '产品名称'")
    private String productName;

    /* * 当前阶段 */
    @Column(name = "stage", columnDefinition = "varchar(32) NOT NULL COMMENT '当前阶段'")
    private String stage;

    /* * 当前步骤 */
    @Column(name = "step", columnDefinition = "varchar(64)  COMMENT '当前步骤'")
    private String step;

    @Column(name = "apply_creator_id", columnDefinition = "bigint(19) comment '申请人ID'")
    private Long applyCreatorId;

    @Column(name = "apply_creator_name", columnDefinition = "varchar(100) comment '申请人'")
    private String applyCreatorName;


    /* * 融资申请日期 */
    @Column(name = "apply_date", columnDefinition = "datetime comment '融资申请日期'")
    private Date applyDate;

    /* *
     * 姓名
     */
    @Column(name = "name", columnDefinition = "varchar(128) comment '姓名'")
    private String name;


    @Column(name = "channel_no", columnDefinition = "varchar(12) comment '渠道类型'")
    private String channelNo = "0";

    @Column(name = "merchant_no", columnDefinition = "varchar(12) comment '平台类型'")
    private String merchantNo = "OWNER";

    @Column(name = "img_id", columnDefinition = "varchar(64) comment '图片编号'")
    private String imgId;

    @Column(name = "card_id", columnDefinition = "varchar(64) comment '身份证号'")
    private String cardId;

    @Column(name = "address", columnDefinition = "varchar(64) comment '地址'")
    private String address;

    @Column(name = "phone", columnDefinition = "varchar(64) comment '电话'")
    private String phone;

    @Column(name = "card_no", columnDefinition = "varchar(64) comment '银行卡号'")
    private String cardNo;

    @Column(name = "code", columnDefinition = "varchar(64) comment '短信验证码'")
    private String code;

    @Column(name = "batch_no", columnDefinition = "varchar(64) comment '发票授权批次号'")
    private String batchNo;

    @Column(name = "face_url", columnDefinition = "varchar(150) comment '人脸识别回显URL'")
    private String faceUrl;
    /**
     * 贷款期限
     */
    @Column(name = "loan_term", columnDefinition = "varchar(64) comment '贷款期限'")
    private ProductUseTimeEnum loanTerm;

    /**
     * 申请金额
     */
    @Column(name = "applications_amount", columnDefinition = "int(10) comment '申请金额'")
    private Integer applicationsAmount;

    /**
     * 还款方式
     */
    @Column(name = "repayment_method", columnDefinition = "varchar(64) comment '还款方式'")
    private RepaymentEnum repaymentMethod;

    /**
     * 还款周期
     */
    @Column(name = "repayment_cycle", columnDefinition = "varchar(64) comment '还款周期'")
    private ProductLoanLimitTimeEnum repaymentCycle;

    /**
     * 贷款用途
     */
    @Column(name = "loan_purpose", columnDefinition = "varchar(64) comment '贷款用途'")
    private LoanPurposeEnum loanPurpose;

    /**
     * 定期还款单位
     */
    @Column(name = "repayment_period_unit", columnDefinition = "varchar(64) comment '定期还款单位'")
    private String repaymentPeriodUnit;

    @Column(name = "location", columnDefinition = "varchar(64) comment '授权地点'")
    private String location;

    /**企业名称*/
    @Column(name = "ent_name", columnDefinition = "varchar(64) comment '企业名称'")
    private String entName;

    @Column(name = "is_true", columnDefinition = "varchar(64) comment '人脸识别结果'")
    private String isTrue;

    @Column(name = "tax_url", columnDefinition = "varchar(150) comment '授权回调URL'")
    private String taxUrl;

    @Column(name = "authorization_date", columnDefinition = "datetime comment '税务授权日期'")
    private Date authorizationDate;
    /**企业法人Id*/
    @Column(name = "ent_legal_id", columnDefinition = "bigint(19) COMMENT '企业法人Id'")
    private Long entLegalId;

    @Column(name="capital_name",columnDefinition = "varchar(50) comment '资金方名称'")
    private String capitalName;

    @Column(name = "capital_side_no",columnDefinition ="varchar(50) comment '资金方编号'")
    private String capitalSideNo;

    @Column(name = "company_address", columnDefinition = "varchar(64) comment '企业地址'")
    private String companyAddress;

    @Column(name = "company_social_credit", columnDefinition = "varchar(64) comment '企业统一社会信用代码'")
    private String companySocialCredit;

    @Column(name = "file_id", columnDefinition = "varchar(64) comment '文件id'")
    private String fileId;

    @Column(name = "order_state_enum", columnDefinition = "varchar(64) comment '订单状态枚举'")
    private OrderStateEnum orderStateEnum;



    @Column(name = "order_no", columnDefinition = "varchar(64) comment '订单号'")
    private String OrderNO;

    @Column(name = "global_status_code", columnDefinition = "int(11) comment '订单生命状态编号'")
    private String GlobalStatusCode;

    @Column(name = "credit_pass_date",
            insertable = false,
            updatable = false,
            columnDefinition = "timestamp(3) NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3) COMMENT '授信通过时间'")
    private Date CreditPassDate;


    @Column(name = "protocol_file", columnDefinition = "varchar(64) comment '协议文件'")
    private String protocolFile;


    /**
     * 申请流水号
     */
    @Column(name = "channel_apply_no", columnDefinition = "varchar(64) comment '申请流水号'")
    private String channelApplyNo;


    /**
     * 证件人像面附件
     */
    @Column(name = "card_front_obs_id", columnDefinition = "varchar(64) comment '证件人像面附件'")
    private String cardFrontObsId;

    /**
     * 证件国徽面附件
     */
    @Column(name = "card_back_obs_id", columnDefinition = "varchar(64) comment '证件国徽面附件'")
    private String cardBackObsId;

    /**
     * 营业执照附件
     */
    @Column(name = "business_license_obs_id", columnDefinition = "varchar(64) comment '营业执照附件'")
    private String businessLicenseObsId;

    /**
     * 企业机构id
     */
    @Column(name = "enterprise_org_id", columnDefinition = "bigint(19) comment '企业机构id'")
    private Long enterpriseOrgId;


    /**
     * 企业客户Id
     */
    @Column(name = "enterprise_id", columnDefinition = "bigint(19) comment '企业客户Id'")
    private Long enterpriseId;

    /**
     * 营业执照号
     */
    @Column(name = "ent_credit_code", columnDefinition = "varchar(64) comment '营业执照号'")
    private String entCreditCode;
}

